package com.xuelang.pipeline.client.resource;

import com.xuelang.pipeline.client.common.request.PageParam;
import com.xuelang.pipeline.client.common.result.ApiResult;
import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.resource.dto.CloudEnvironmentDTO;
import com.xuelang.pipeline.client.resource.dto.CloudEnvironmentQuery;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;
import java.util.List;

/**
 * 多云环境服务API
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
public interface ICloudEnvironmentService {

    /**
     * 查询多云环境列表(有过滤条件，可以分页)
     *
     * @param dtoPageParam
     * @return
     */
    @PostMapping(value = "/pageList", produces = "application/json;charset=utf-8")
    ApiResult<PageRecord<CloudEnvironmentDTO>> pageCloudEnvironmentList(@RequestBody @Valid PageParam<CloudEnvironmentQuery> dtoPageParam);

    /**
     * 查询多云环境列表(有过滤条件)
     *
     * @param cloudEnvironmentQuery
     * @return
     */
    @PostMapping(value = "/list", produces = "application/json;charset=utf-8")
    ApiResult<List<CloudEnvironmentDTO>> conditionalCloudEnvironmentList(@RequestBody @Valid CloudEnvironmentQuery cloudEnvironmentQuery);
    /**
     * 新增多云环境
     *
     * @param cloudEnvironmentDTO
     * @return
     */
    @PostMapping(value = "", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> addCloudEnvironment(@RequestBody @Valid CloudEnvironmentDTO cloudEnvironmentDTO);

    /**
     * 更新多云环境
     *
     * @param cloudEnvironmentDTO
     * @return
     */
    @PutMapping(value = "", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> updateCloudEnvironment(@RequestBody @Valid CloudEnvironmentDTO cloudEnvironmentDTO);

    /**
     * 删除多云环境
     *
     * @param id
     * @return
     */
    @DeleteMapping(value = "/{id}", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> deleteCloudEnvironment(@PathVariable("id") Long id);
    /**
     * 查询多云环境
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/{id}", produces = "application/json;charset=utf-8")
    ApiResult<CloudEnvironmentDTO> queryCloudEnvironment( @PathVariable("id") Long id);

}
